	package com.rm2pt.generator.springboot.LabManage.entity;
	
	import org.hibernate.annotations.Fetch;
	import org.hibernate.annotations.FetchMode;
	import com.fasterxml.jackson.annotation.JsonBackReference;
	import com.fasterxml.jackson.annotation.JsonIgnore;
	import javax.persistence.FetchType;
	import java.util.ArrayList;
	import javax.persistence.OneToMany;
	import javax.persistence.OneToOne;
	import javax.persistence.CascadeType;
	import java.util.Date;
	import java.util.List;
	import java.io.Serializable;
	import javax.persistence.Entity;
	import javax.persistence.Transient;
	import javax.persistence.GeneratedValue;
	import javax.persistence.GenerationType;
	import javax.persistence.Id;
	import javax.persistence.JoinColumn;
	import javax.persistence.ManyToOne;
	import com.fasterxml.jackson.annotation.ObjectIdGenerators;
	import com.fasterxml.jackson.annotation.JsonIdentityInfo;
	
	@Entity
	public class Student extends User {
		
		/* all primary attributes */
		private String className;
		public String getClassName() {
			return className;
		}
		public void setClassName(String ClassName) {
			this.className = ClassName;
		}	
			

		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="dailyBelongStudent")
				private List<Daily> studentOwnDaily = new ArrayList<Daily>();
					
		public List<Daily> getStudentOwnDaily() {
			return studentOwnDaily;
		}
				
		public void setStudentOwnDaily(List<Daily> StudentOwnDaily) {
			this.studentOwnDaily = StudentOwnDaily;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="planBelongStudent")
				private List<Plan> studentOwnPlan = new ArrayList<Plan>();
					
		public List<Plan> getStudentOwnPlan() {
			return studentOwnPlan;
		}
				
		public void setStudentOwnPlan(List<Plan> StudentOwnPlan) {
			this.studentOwnPlan = StudentOwnPlan;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="applytoStudent")
				private List<Apply> studentOwnApply = new ArrayList<Apply>();
					
		public List<Apply> getStudentOwnApply() {
			return studentOwnApply;
		}
				
		public void setStudentOwnApply(List<Apply> StudentOwnApply) {
			this.studentOwnApply = StudentOwnApply;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER)
				private List<StudentInTeam> studentInTeamLink = new ArrayList<StudentInTeam>();
					
		public List<StudentInTeam> getStudentInTeamLink() {
			return studentInTeamLink;
		}
				
		public void setStudentInTeamLink(List<StudentInTeam> StudentInTeamLink) {
			this.studentInTeamLink = StudentInTeamLink;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER)
				private List<StudentInGroup> studentInGroupLink = new ArrayList<StudentInGroup>();
					
		public List<StudentInGroup> getStudentInGroupLink() {
			return studentInGroupLink;
		}
				
		public void setStudentInGroupLink(List<StudentInGroup> StudentInGroupLink) {
			this.studentInGroupLink = StudentInGroupLink;
		}
		
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Student other = (Student) obj;
			if (!this.getRealid().equals(other.getRealid()))
				return false;
			else
				return true;
		}
	}
